package Demo22;

import java.time.chrono.MinguoDate;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-20
 * Time: 18:59
 */
class Employee {
    private String name,type;

    public Employee(String name, String type) {
        this.name = name;
        this.type = type;
    }
    public int getSalary() {
        return 0;
    }
}
class Manager extends Employee{
    private int salary;

    public Manager(String name, String type, int salary) {
        super(name, type);
        this.salary = salary;
    }

    @Override
    public int getSalary() {
        return salary;
    }
}
class Salesman extends Employee{
    private int salary;
    private int salaryRaise;

    public Salesman(String name, String type, int salary, int salaryRaise) {
        super(name, type);
        this.salary = salary;
        this.salaryRaise = salaryRaise;
    }

    @Override
    public int getSalary() {
        return salary+salaryRaise;
    }

}
class Worker extends Employee{
    private int salary;
    private int day;

    public Worker(String name, String type, int salary, int day) {
        super(name, type);
        this.salary = salary;
        this.day = day;
    }

    @Override
    public int getSalary() {
        return salary*day;
    }
}
/* 请在这里填写答案 */

public class Main {
    public static void main(String[] args) {
        Employee e1 = new Manager("张山","经理",6000);
        Employee e2 = new Salesman("李四","销售员",3000, 4000);
        Employee e3 = new Worker("王五","工人",200, 22);
        print(e1);
        print(e2);
        print(e3);
    }
    public static void print(Employee e) {
        System.out.println(e.getSalary());
    }
}